package guoanmaker.personal.business.controller;

import javax.annotation.Resource;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import guoanmaker.personal.business.service.PersonalChannelstatisticsServiceInterface;
import guoanmaker.personal.helper.common.AjaxJson;
import guoanmaker.personal.helper.common.abstractobj.ApiController;
import io.swagger.annotations.ApiOperation;

@RestController
@RequestMapping(ApiController.USERSTATISTICS_URL)
public class PersonalChannelstatisticsController {

	
	@Autowired  
	private  PersonalChannelstatisticsServiceInterface personalChannelstatisticsServiceInterface;
	
	@ApiOperation(value = "保存平台渠道号", notes = "保存平台渠道号")
	@RequestMapping(value = "/saveChannelstatistics", method = RequestMethod.POST)
	public AjaxJson saveChannelstatistics(int channel,int platform){
		AjaxJson ajaxJson=new AjaxJson();
		try {
			ajaxJson.setSuccess(true).setStatus(200).setMsg("操作成功").setData(personalChannelstatisticsServiceInterface.saveChannelstatistics(channel, platform));
		} catch (Exception e) {
			e.printStackTrace();
			ajaxJson.setSuccess(true).setStatus(250).setMsg("操作成功").setData("失败");
		}
		return ajaxJson;
	}
}
